import { upgradeLogList } from '@/mock/upgradeLog'
import { RoutesAlias } from '../routesAlias'
import { MenuListType } from '@/types/menu'
import { WEB_LINKS } from '@/utils/links'

/**
 * 菜单列表、异步路由
 *
 * 支持两种模式:
 * 1. 前端静态配置 - 直接使用本文件中定义的路由配置
 * 2. 后端动态配置 - 后端返回菜单数据，前端解析生成路由
 *
 * 菜单标题（title）:
 * 可以是 i18n 的 key，也可以是字符串，比如：'用户列表'
 */

export const asyncRoutes: MenuListType[] = [
  {
    id: 18,
    name: 'Dashboard',
    path: '/dashboard',
    component: '/dashboard/console',
    meta: {
      title: 'menus.dashboard.title',
      icon: '&#xe721;',
      keepAlive: false,
      isInMainContainer: true
    }
  },
  // {
  //   id: 1,
  //   name: 'Dashboard',
  //   path: '/dashboard',
  //   component: RoutesAlias.Home,
  //   meta: {
  //     title: 'menus.dashboard.title',
  //     icon: '&#xe721;',
  //     keepAlive: false
  //   },
  //   children: [
  //     {
  //       id: 11,
  //       path: 'console',
  //       name: 'Console',
  //       component: RoutesAlias.Dashboard,
  //       meta: {
  //         title: 'menus.dashboard.console',
  //         keepAlive: false
  //       }
  //     }
  //     // {
  //     //   id: 12,
  //     //   path: 'analysis',
  //     //   name: 'Analysis',
  //     //   component: RoutesAlias.Analysis,
  //     //   meta: {
  //     //     title: 'menus.dashboard.analysis',
  //     //     keepAlive: false
  //     //   }
  //     // }
  //     // {
  //     //   id: 13,
  //     //   path: 'ecommerce',
  //     //   name: 'Ecommerce',
  //     //   component: RoutesAlias.Ecommerce,
  //     //   meta: {
  //     //     title: 'menus.dashboard.ecommerce',
  //     //     keepAlive: false
  //     //   }
  //     // }
  //   ]
  // },
  {
    id: 2,
    path: '/role',
    name: 'Role',
    component: '/role/index',
    meta: {
      title: '角色管理',
      icon: '&#xe73a;',
      keepAlive: false,
      isInMainContainer: true
    }
  },
  {
    id: 2,
    path: '/foods',
    name: 'Foods',
    component: RoutesAlias.Home,
    meta: {
      title: '食谱管理',
      icon: '&#xe7d5;',
      keepAlive: false
    },
    children: [
      {
        id: 201,
        path: 'recipes',
        name: 'Recipes',
        component: '/foods/recipes',
        meta: {
          title: '食物列表',
          icon: '&#xe7ce;',
          keepAlive: true
        }
      },
      {
        id: 202,
        path: 'eat',
        name: 'Eat',
        component: '/foods/eat',
        meta: {
          title: '饮食列表',
          icon: '&#xe7e7;',
          keepAlive: true
        }
      },
      {
        id: 203,
        path: 'article',
        name: 'Article',
        component: '/foods/article',
        meta: {
          title: '食谱文章',
          icon: '&#xe84d;',
          keepAlive: false
        }
      }
    ]
  },
  {
    id: 3,
    path: '/heat',
    name: 'Heat',
    component: RoutesAlias.Home,
    meta: {
      title: '热量管理',
      icon: '&#xe737;',
      keepAlive: true
    },
    children: [
      {
        id: 303,
        path: 'type',
        name: 'Type',
        component: '/heat/type',
        meta: {
          title: '热量分类',
          icon: '&#xe882;',
          keepAlive: false
        }
      },
      {
        id: 304,
        path: 'h-list',
        name: 'HList',
        component: '/heat/list',
        meta: {
          title: '热量列表',
          icon: '&#xe64e;',
          keepAlive: true
        }
      }
    ]
  },
  {
    id: 4,
    path: '/knowledge',
    name: 'Knowledge',
    component: RoutesAlias.Home,
    meta: {
      title: '减脂知识',
      icon: '&#xe7be;',
      keepAlive: true
    },
    children: [
      {
        id: 403,
        path: 'k-type',
        name: 'KType',
        component: '/knowledge/type',
        meta: {
          title: '知识分类',
          icon: '&#xe8c6;',
          keepAlive: false
        }
      },
      {
        id: 404,
        path: 'k-list',
        name: 'KList',
        component: '/knowledge/list',
        meta: {
          title: '知识列表',
          icon: '&#xe83b;',
          keepAlive: false
        }
      },
      {
        id: 405,
        path: 'k-detail',
        name: 'KDetail',
        component: '/knowledge/detail',
        meta: {
          title: '知识详情',
          icon: '&#xe83b;',
          keepAlive: true,
          isHide: true
        }
      }
    ]
  },
  {
    id: 6,
    path: '/goods',
    name: 'Goods',
    component: RoutesAlias.Home,
    meta: {
      title: '商品管理',
      icon: '&#xe894;',
      keepAlive: false
    },
    children: [
      {
        id: 601,
        path: 'list',
        name: 'List',
        component: '/goods/index',
        meta: {
          title: '商品列表',
          icon: '&#xe77f;',
          keepAlive: false
        }
      },
      {
        id: 601,
        path: 'discount',
        name: 'Discount',
        component: '/goods/discountList',
        meta: {
          title: '折扣商品列表',
          icon: '&#xe701;',
          keepAlive: false
        }
      }
    ]
  },
  {
    id: 8,
    path: '/person',
    name: 'Person',
    component: RoutesAlias.Home,
    meta: {
      title: '个人中心',
      icon: '&#xe724;',
      keepAlive: true
    },
    children: [
      {
        id: 801,
        path: 'user',
        name: 'User',
        component: '/personal/user',
        meta: {
          title: '用户列表',
          icon: '&#xe608;',
          keepAlive: true
        }
      },
      {
        id: 802,
        path: 'privacy',
        name: 'Privacy',
        component: '/agreement/privacy',
        meta: {
          title: '隐私协议',
          icon: '&#xe882;',
          keepAlive: true
        }
      },
      {
        id: 803,
        path: 'customer',
        name: 'Customer',
        component: '/agreement/user',
        meta: {
          title: '用户协议',
          icon: '&#xe64e;',
          keepAlive: true
        }
      }
    ]
  },
  {
    id: 9,
    path: '/banner',
    name: 'Banner',
    component: RoutesAlias.Home,
    meta: {
      title: 'banner管理',
      icon: '&#xe6ee;',
      keepAlive: true
    },
    children: [
      {
        id: 901,
        path: 'home',
        name: 'Home',
        component: '/banner/home',
        meta: {
          title: '首页banner',
          icon: '&#xe8c8;',
          keepAlive: true
        }
      },
      {
        id: 902,
        path: 'personal',
        name: 'Personal',
        component: '/banner/personal',
        meta: {
          title: '个人中心banner',
          icon: '&#xe892;',
          keepAlive: true
        }
      },
      {
        id: 903,
        path: 'mall',
        name: 'Mall',
        component: '/banner/mall',
        meta: {
          title: '商城banner',
          icon: '&#xe6ec;',
          keepAlive: true
        }
      }
    ]
  },
  {
    id: 5,
    path: '/faq',
    name: 'Faq',
    component: '/FAQ/index',
    meta: {
      title: 'FAQ管理',
      icon: '&#xe720;',
      keepAlive: false,
      isInMainContainer: true
    }
  },
  {
    id: 13,
    path: '/activity',
    name: 'Activity',
    component: '/activity/index',
    meta: {
      title: '活动管理',
      icon: '&#xe84b;',
      keepAlive: false,
      isInMainContainer: true
    }
  },
  {
    id: 7,
    path: '/order',
    name: 'Order',
    component: '/order/list',
    meta: {
      title: '订单管理',
      icon: '&#xe762;',
      keepAlive: false,
      isInMainContainer: true
    }
  },
  {
    id: 14,
    path: '/complaint',
    name: 'Complaint',
    component: '/complaint/index',
    meta: {
      title: '投诉管理',
      icon: '&#xe758;',
      keepAlive: false,
      isInMainContainer: true
    }
  },
  {
    id: 10,
    path: 'art-detail',
    name: 'ArtDetail',
    component: '/knowledge/detail',
    meta: {
      title: '文章详情',
      icon: '&#xe83b;',
      keepAlive: false,
      isInMainContainer: true,
      isHide: true
    }
  },
  {
    id: 12,
    path: '/configured',
    name: 'Configured',
    component: '/configured/index',
    meta: {
      title: 'app配置',
      icon: '&#xe6d0;',
      keepAlive: false,
      isInMainContainer: true
    }
  }
]
